package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BussOrderMapper;
import com.ruoyi.system.domain.BussOrder;
import com.ruoyi.system.service.IBussOrderService;

/**
 * 订单Service业务层处理
 * 
 * @author rey
 * @date 2022-10-27
 */
@Service
public class BussOrderServiceImpl implements IBussOrderService 
{
    @Autowired
    private BussOrderMapper bussOrderMapper;

    /**
     * 查询订单
     * 
     * @param id 订单主键
     * @return 订单
     */
    @Override
    public BussOrder selectBussOrderById(Long id)
    {
        return bussOrderMapper.selectBussOrderById(id);
    }

    /**
     * 查询订单列表
     * 
     * @param bussOrder 订单
     * @return 订单
     */
    @Override
    public List<BussOrder> selectBussOrderList(BussOrder bussOrder)
    {
        return bussOrderMapper.selectBussOrderList(bussOrder);
    }

    /**
     * 新增订单
     * 
     * @param bussOrder 订单
     * @return 结果
     */
    @Override
    public int insertBussOrder(BussOrder bussOrder)
    {
        bussOrder.setCreateTime(DateUtils.getNowDate());
        return bussOrderMapper.insertBussOrder(bussOrder);
    }

    /**
     * 修改订单
     * 
     * @param bussOrder 订单
     * @return 结果
     */
    @Override
    public int updateBussOrder(BussOrder bussOrder)
    {
        bussOrder.setUpdateTime(DateUtils.getNowDate());
        return bussOrderMapper.updateBussOrder(bussOrder);
    }

    /**
     * 批量删除订单
     * 
     * @param ids 需要删除的订单主键
     * @return 结果
     */
    @Override
    public int deleteBussOrderByIds(Long[] ids)
    {
        return bussOrderMapper.deleteBussOrderByIds(ids);
    }

    /**
     * 删除订单信息
     * 
     * @param id 订单主键
     * @return 结果
     */
    @Override
    public int deleteBussOrderById(Long id)
    {
        return bussOrderMapper.deleteBussOrderById(id);
    }
}
